package com.sensePlusVR.utils;

import java.util.HashMap;
import java.util.Map;

import android.annotation.SuppressLint;
import android.os.Environment;

import com.sensePlusVR.application.VRApplication;

/**
 * 
 * @author: Loren
 * @create: 2016-7-1下午6:14:27
 * @desc: 常量存储区
 * 
 */
@SuppressLint("SdCardPath")
@SuppressWarnings("unused")
public class Constant {

	public static final String KEY_AES = "QWEREWQWERTREWER";
	/**
	 * 是否为统一用户
	 */
	public static final String IS_SAME_USER = "is_same_user";
	// 是否为第一次安装
	public static final String IS_FIRST_INSTANT = "is_first_instant";
	
	public static final String IS_FIRST_VIDEO_GESTURE = "is_first_video_gesture";
	// 第一次安装设置手势密码
	public static final String IS_FIRST_GUESTURE_EDIT = "is_first_guest_edit";
	//进入GestureVerifyActivity是否需要验证
	public static final String INTENT_GUESTURE_FIRST_RESET = "GestureReset";
	
	public static final String INTENT_GUESTURE_RESET_NOT = "GestureResetNot";
	
//	// 帐号
//	public static final String USERNAME = "user_name";
//	// 密码
//	public static final String PASSWORD = "password";
	// 登录成功后返回的结果-id
	public static final String LOGIN_SUCCESS_ID = "login_success_id";
	// 登录成功后返回的结果-token
	public static final String LOGIN_SUCCESS_TOKEN = "login_success_token";
	//登录成功返回是否需要修改密码
	public static final String LOGIN_SUCCESS_LOCKED = "login_success_locked";
	// 登录成功后返回的结果-有效期
	public static final String LOGIN_SUCCESS_EXPIRES = "login_success_expires";
	// 登录成功后-调用获取帐号信息
	public static final String LOGIN_SUCCESS_LOGINNAME = "login_success_LOGINNAME";
	public static final String LOGIN_SUCCESS_SHOWNAME = "login_success_showname";
	public static final String LOGIN_SUCCESS_SEX = "login_success_sex";
	public static final String LOGIN_SUCCESS_LEVEL = "login_success_level";
	// 注册过程中的_邮箱
	public static final String REGISTER_TEMP_EMAIL = "register_temp_email";
	// 注册过程中的-密码
	public static final String REGISTER_TEMP_PASSWORD = "register_temp_password";
	//手势密码
	public static final String SP_INPUTCODE = "inputCode";
	//存储4G网络开关是否打开，默认关闭
	public static final String SP_NETWORK_MOBILE_STATE = "mobileNetState";
	
	/**
	 * 自动注册邮箱固定后缀
	 */
	public static final String REGISTER_AUTO_EMAIL_SUFFIX = "@sp.vr.unreg";
	/**
	 * 自动注册邮箱固定密码
	 */
	public static final String REGISTER_AUTO_PASSWORD = "senseplusvr";

	//保存用户收藏的gameid
	public static final String USER_FOLLOW_IDS = "user_follow_ids";
	
	public static final String DECODER_VR_RESULT="decoder_vr_result";
	public static final String DECODER_VR_FPS="decoder_vr_fps";
	public static final String GPU_VR_FPS="gpu_vr_fps";
	public static final String GPU_VR2D_FPS="gpu_vr2d_fps";
	public static final String DECODER_2D_RESULT="decoder_2d_result";
	public static final String DECODER_2D_FPS="decoder_2d_fps";
	public static final String GPU_2D_FPS="gpu_2d_fps";
	
	public static final String SENSOR_HAS_ACCEL = "has_accel_sensor";
	public static final String SENSOR_HAS_GRAV = "has_grav_sensor";
	public static final String SENSOR_HAS_GYRO = "has_gyro_sensor";
	
	/**
	 * 性别
	 */
	public class Sex {

		public final static String MAN = "1";// 男1女2
		public final static String WOMAN = "2";
		
		public final static String MALE = "MALE";
		
		public final static String FEMALE = "FEMALE";
	}

	/**
	 * 重置密码的短信验证码
	 */
	public static final String RESET_VER_CODE = "123456";

	// -----------------------------------------------------------------------------

	/*
	 * * UTF-8格式
	 */
	private final static String STR_UTF8 = "UTF-8";
	/**
	 * JSON格式
	 */
	public final static String STR_APPLICATION_JSON = "application/json";

	public final static String STR_CONTENT_TYPE = "Content-Type";
	
	

	/**
	 * 后台验证
	 */
	public final static String STR_X_AUTH_TOKEN = "x-auth-token";
	
	public final static String DEVICE = "device";
	
	public final static String MOBILE = "mobile";

	public final static String ANDROID_PHONE = "Android";

	/**
	 * 手势密码点的状态
	 */
	public static final int POINT_STATE_NORMAL = 0; // 正常状态

	public static final int POINT_STATE_SELECTED = 1; // 按下状态

	public static final int POINT_STATE_WRONG = 2; // 错误状态

	/**
	 * Http返回码相关
	 */
	public static final int HTTP_200 = 200;

	public static final int HTTP_201 = 201;

	/**
	 * 数字常量
	 */
	public static final int NUMBER_N1 = -1;

	public static final int NUMBER_0 = 0;

	public static final int NUMBER_1 = 1;

	public static final int NUMBER_2 = 2;

	public static final int NUMBER_3 = 3;

	public static final int NUMBER_4 = 4;

	public static final int NUMBER_5 = 5;

	public static final int NUMBER_6 = 6;

	public static final int NUMBER_15 = 15;
	
	/**
	 * 字符串常量
	 */
	public static final String STR_EMPTY = "";
	

	/**
	 * sharedprefrence key
	 */
	/**
	 * 蓝牙地址
	 */
	public static final String SP_BLUE_ADDRESS = "blueAddress";
	
	public static final String SP_BLUE_NAME = "blueName";
	
	public static final String SP_BLUE_IS_FROM_SETTING = "blueFrom";
	/**
	 * 从Uinity返回（由于Uinity返回有BUG,所以做标记为了区分是否显示手势密码）
	 */

	/**
	 * 拦截手势事件
	 */
	//public static final String SP_INTERCEPT_DISPATCHEVENT = "interceptDispatchevent";
	/**
	 * Intent key
	 */
	public static final String INTENT_PHONE = "phone";

	public static final String INTENT_VERCODE = "verCode";

	public static final String INTENT_VIEWPAGER_POSITION = "position";

	public static final String INTENT_GAME_DETAIL = "gameDetail";

	public static final String INTENT_BOTTOM_POP = "bottomPop";

	public static final String INTENT_VIDEO_PLAY = "videoPlay";

	public static final String INTENT_FOLLOW_DETAIL_ACTOR_FROM = "isFromPage";

	public static final String INTENT_FOLLOW_DETAIL = "followDetail";
	
	public static final String INTENT_SHOW_FOLLOW_DETAIL = "isShowFollowDetail";

	public static final String INTENT_FOLLOW_DETAIL_ACTORITEM = "followDetailList";
	
	public static final String INTENT_GAME_PLAY_LIST = "videoPlayList";
	
	public static final String INTENT_GAMEITEM = "gameItem";
	
	public static final String INTENT_COMMENDITEM = "commendItem";

	public static final String INTENT_USER_NAME = "userName";

	public static final String INTENT_USER_PWD = "password";

	public static final String INTENT_ACTOR_POSITION = "actorPosition";

	public static final String INTENT_ACTOR_ISVR = "isvrplay";
	
	
	public static final int GAME_MODE_VR = 2;
	public static final int GAME_MODE_2D = 1;
	
	/**
	 * VR或者2D中区分互动还是播放
	 */
	public static final String GAME_MODE_GAME_STR = "game";
	public static final String GAME_MODE_VIDEO_STR = "video";
	
	
	public static final String STR_VR = "VR";
	public static final String STR_2D = "2D";
	
	
	/**
	 * 区别进入BlueScan是从Game中进入还是Setting中
	 */
	public static final String INTENT_BLUE_FROM_SETTING = "fromBlueSetting";
	
	public static final String INTENT_FROM_MODIFY_PASSWORD = "fromModifyPassword";
	
	
	public static final String INTENT_FEEDBACK_FEEDBACKID = "feedbackId";
	


	/**
	 * SdCard 是否存在
	 */
	public static final boolean SDCARD_EXIST = Environment
			.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);

	
	public static final String PATH_APK_DIR = "/APKDownload";
	
	public static final String PATH_APK = PATH_APK_DIR+"/SensePlusVR.apk";
	


	
	/**
	 * 下载状态
	 * 301开始下载
	 * 302正在下载
	 * 303下载完成
	 * 304还没有开始下载
	 */
	public static final int DOWN_STATE_TEXT_NORMAL = 301;
	public static final int DOWN_STATE_TEXT_LOADING = 302;
	public static final int DOWN_STATE_TEXT_LOADED = 303;
	public static final int DOWN_STATE_TEXT_INITED = 304;
	/**
	 * 暂停继续下载状态
	 * 304暂停下载
	 * 305继续下载
	 */
	public static final int DOWN_STATE_STOP = 304;
	public static final int DOWN_STATE_RESUME = 305;
	
	/**
	 * 邮箱验证根据不同邮箱进入相应邮箱网页
	 */
	public static Map<String, String> emailMaps = new HashMap<String, String>();

	static {
		emailMaps.put("qq.com", "http://mail.qq.com");
		emailMaps.put("gmail.com", "http://mail.google.com");
		emailMaps.put("sina.com", "http://mail.sina.com.cn");
		emailMaps.put("163.com", "http://mail.163.com");
		emailMaps.put("126.com", "http://mail.126.com");
		emailMaps.put("yeah.net", "http://www.yeah.net/");
		emailMaps.put("sohu.com", "http://mail.sohu.com/");
		emailMaps.put("tom.com", "http://mail.tom.com/");
		emailMaps.put("sogou.com", "http://mail.sogou.com/");
		emailMaps.put("139.com", "http://mail.10086.cn/");
		emailMaps.put("hotmail.com", "http://www.hotmail.com");
		emailMaps.put("live.com", "http://login.live.com/");
		emailMaps.put("live.cn", "http://login.live.cn/");
		emailMaps.put("live.com.cn", "http://login.live.com.cn");
		emailMaps.put("189.com", "http://webmail16.189.cn/webmail/");
		emailMaps.put("yahoo.com.cn", "http://mail.cn.yahoo.com/");
		emailMaps.put("yahoo.cn", "http://mail.cn.yahoo.com/");
		emailMaps.put("eyou.com", "http://www.eyou.com/");
		emailMaps.put("21cn.com", "http://mail.21cn.com/");
		emailMaps.put("188.com", "http://www.188.com/");
		emailMaps.put("foxmail.coom", "http://www.foxmail.com");
	}
	/**
	 * 清理缓存路径
	 */
	public static final String PATH_CACHE_IMAGES = "/images";
	public static final String PATH_CACHE_VIDEOS = "/video";
	public static final String PATH_CACHE_UNITYSHADER = "/UnityShaderCache";
	public static final String PATH_CACHE_MOVIES = "/Movies";
	public static final String PATH_CACHE_ULUA = "/uLua";
	
	
	//非真人资源路径
	public static final String PATH_UNREAL = "/unReal";
	
	//安卓log
	public static final String PATH_ANDROID_LOG ="/Log/AndroidLog.txt";
	//本地局域网URL
	public static final String PATH_NATIVE_URL = "/Log/nativeUrl.txt";
	
	//是否进入本地测试
	public static boolean nativeBundleSwitch = false;
	
	//本地测试game的目录名
	public static String nativeBundleName = null;
	//本地测试
	public static final String NATIVE_BUNDLE_SWITCH = "nativeBundleSwitch=";
	/**
	 * 已经下载并且已经收藏
	 */
	public static final int DOWNLOAD_YES_COLLECTION_YES = 1;
	/**
	 * 没有下载已经收藏
	 */
	public static final int DOWNLOAD_NO_COLLECTION_YES = 2;
	/**
	 * 已经下载没有收藏
	 */
	public static final int DOWNLOAD_YES_COLLECTION_NO = 3;
	/**
	 * CollectionListAdapter标记来自哪个RecyclerView
	 */
	public static final int FROM_DOWNLOADED = 4;
	
	public static final int FROM_COLLECTION = 5;
	
	public static final int FROM_NOT_DOWNLOADED = 6;
	/**
	 * FollowDetailActivity中标记从哪个Item进入
	 */
	public static final int FROM_FOLLOW_FOLLOW = 7;
	
	public static final int FROM_FOLLOW_ALL = 8;
	//所有
	public static final String TYPE_ALL = "all";
	//真人
	public static final String TYPE_REAL = "real";
	//游戏
	public static final String TYPE_LIKEREAL = "likereal";
	//卡通
	public static final String TYPE_CATONG = "catong";
	//demo 真人
	public static final String TYPE_DEMO_REAL = "demo_real";
	//demo 游戏
	public static final String TYPE_DEMO_LIKEREAL = "demo_likereal";
	
	public static final String TYPE_EQ_V4 = "v4";
	public static final String TYPE_EQ_V5 = "v5";
	public static final String TYPE_EQ_V6 = "v6";
	
	//蓝牙按键
	
	public static final int BT_KEY_ADD = 0;
	
	public static final int BT_KEY_O = 1;
	
	public static final int BT_KEY_SUB = 2;
	
	public static final int BT_KEY_MAX = 3;
	
	public static final int BT_ACTION_LONG = 0;
	
	public static final int BT_ACTION_ONE = 1;
	
	public static final int BT_ACTION_TWO = 2;
	
	public static final int BT_ACTION_THREE = 3;
	
	/**
	 * 当前顶部导航栏是否可见
	 */
	//public static boolean isShowTopBar = true;
	/**
	 * 播放按钮添加动画时长
	 */
	public static final int ANIMATION_PLAY_BUTTON_DURATION = 200;
	
	/**
	 * 特殊符号
	 */
	public static final String SYMBOL_PERCENTAGE = "%";
	
	public static final String SYMBOL_INTHEBAR = "- -";
	
	/**
	 * 蓝牙类型
	 */
	public static final String SENSE_TUBE = "SenseTube";
	
	public static final String SENSE_BAND = "SenseBand";
	
	/**
	 * 服务器返回消息Key
	 */
	public static final String SERVER_SUCCESS_KEY_E000 = "E000";
	public static final String SERVER_ERROR_KEY_E101 = "E101";
	public static final String SERVER_ERROR_KEY_E103 = "E103";
	public static final String SERVER_ERROR_KEY_E104 = "E104";
	public static final String SERVER_ERROR_KEY_E106 = "E106";
	public static final String SERVER_ERROR_KEY_E108 = "E108";
	public static final String SERVER_ERROR_KEY_E109 = "E109";
	public static final String SERVER_ERROR_KEY_E112 = "E112";
	public static final String SERVER_ERROR_KEY_E113 = "E113";
	public static final String SERVER_ERROR_KEY_E114 = "E114";
	public static final String SERVER_ERROR_KEY_E115 = "E115";
	public static final String SERVER_ERROR_KEY_E116 = "E116";
	public static final String SERVER_ERROR_KEY_E117 = "E117";
	public static final String SERVER_ERROR_KEY_E118 = "E118";
	public static final String SERVER_ERROR_KEY_E119 = "E119";//注册时候没有邮箱验证时标记
	
	public static final String SERVER_ERROR_KEY_E200 = "E200";
	public static final String SERVER_ERROR_KEY_E201 = "E201";
	public static final String SERVER_ERROR_KEY_E202 = "E202";
	public static final String SERVER_ERROR_KEY_E203 = "E203";
	public static final String SERVER_ERROR_KEY_E301 = "E301";
	public static final String SERVER_ERROR_KEY_E302 = "E302";
	public static final String SERVER_ERROR_KEY_E303 = "E303";
	public static final String SERVER_ERROR_KEY_E410 = "E410";
	public static final String SERVER_ERROR_KEY_E601 = "E601";
	public static final String SERVER_ERROR_KEY_E602 = "E602";
	public static final String SERVER_ERROR_KEY_E701 = "E701";
	public static final String SERVER_ERROR_KEY_E801 = "E801";
	
	public static final String SERVER_ERROR_KEY_E999 = "E999";//必须开启VPN才能进入
	
	/**
	 * 点击不同的超链接标记
	 */
	public static final String INTENT_HYPERLINK_KEY = "hyperlinkkey";
	public static final String INTENT_HYPERLINK_FAQ = "faq";
	public static final String INTENT_HYPERLINK_OURTERMS = "ourTerms";
	//public static final String INTENT_HYPERLINK_CONDITIONS = "conditions";
	public static final String INTENT_HYPERLINK_PRIVACY_POLICY = "privacyPolicy";
	public static final String INTENT_HYPERLINK_COMPLIANCE_STATEMENT = "complianceStatement";
	
	//数据库版本
	public static final int dbVersion = 12;
	
	/**
	 * Byte 分别转换为KB,MB,GB
	 */
	
	public static final long SPEED_CONVERSION_UNIT = 1024;
	
	public static final long BYTE_CONVERSION_KB = 1024;
	
	public static final long BYTE_CONVERSION_MB = (1024*1024);
	
	public static final long BYTE_CONVERSION_GB = (1024*1024*1024);
	
	public static final String CPUINFO_CPUCODE_UNKNOW = "unknow";
	
	public static final String KB_PS = "K/s";
	
	public static final String MB_PS = "M/s";
	
	public static final String STRIKE_THROUGH = "--";
	
	public static final String GB = "G";
	
	public static final String MB = "M";
	
	public static final String KB = "KB";
	
	public static final String B = "B";
	
	/**
	 * 每个界面存储是否显示新功能提示标记
	 */
	public static final String SP_GUIDE_VIDEODETALI_DIALOG = "guideVideoDetailDialog";
	
	public static final String SP_DOWNLOADED_COLLECTIONS = "downloadedCollections";
	
	/**
	 * 服务端定义字符值
	 */
	public static final String VALUE_CLIENT_TYPE = "1";
	
	public static final String VALUE_CLIENT_ID_DEBUG = "5965d0d02eab2843ba849482";
	
	public static final String VALUE_CHANNEL_ID_DEBUG = "5969d6211929b03a83578e74";
	
	public static final String VALUE_CLIENT_ID_PROD = "59f99072f77957b9d01fdf7f";
	
	public static final String VALUE_CHANNEL_ID_PROD = "59f98fe2f77957b9d01fdf7c";
	
	/**
	 * Umeng appKey
	 */
	public static final String VALUE_UMENG_APPKEY = "5a140c8ea40fa303e200012d";
	
	
	/**
	 * 埋点Event
	 */
	public static final String BURIED_GAME_DOWNLOAD = "GAME_DOWNLOAD";
	public static final String BURIED_GAME_DOWNLOAD_ADD = "GAME_DOWNLOAD_ADD";
	public static final String BURIED_GAME_PLAY = "GAME_PLAY";
	public static final String BURIED_GAME_FOLLOW_ADD = "FOLLOW_ADD";
	public static final String BURIED_GAME_FOLLOW_CANCEL = "FOLLOW_REMOVE";
	
	/**
	 * APP 版本类型（在ConstanURL中做判断）
	 */
	public static final String BURIED_MODE_DEBUG = "Debug";
	public static final String BURIED_MODE_PROD = "Prod";
	
	/**
	 * 埋点 Flag
	 */
	public static final int BURIED_FLAG_CANCEL = -1;
	public static final int BURIED_FLAG_FAIL = 0;
	public static final int BURIED_FLAG_SUCCESS = 1;
	
	public static final int BURIED_STATE_FAIL = -1;
	public static final int BURIED_STATE_NOMAL = 0;
	public static final int BURIED_STATE_SUCCESS = 1;
	
	
	public static final String VALUE_USER_AGENT = "SLovers/" + VersionUtil.getVersionNameOnlyNum(VRApplication.getAppContext()) 
			+ " (" + AndroidDeviceUtil.getPhoneBrand() + " " + AndroidDeviceUtil.getPhoneModel() + "; android " + AndroidDeviceUtil.getBuildVersion()+ ")";
	
	public static final String CLASS_NAME_MAIN = "MainActivity";

	
	public static final String URL_SEGPAY = "http://cs.segpay.com/";
	
	/**
	 * 网络类型提示区分：1 提示用户连接wifi 2 提示用户连接网络
	 */
	public static final int NETWORK_TYPE_NULL = 0;
	public static final int NETWORK_TYPE_CONNECT_WIFI = 1;
	public static final int NETWORK_TYPE_CONNECT_NETWORK = 2;
	
}
